package com.itheima.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.dto.DishDto;
import com.itheima.entity.Dish;
import org.springframework.transaction.annotation.Transactional;

/**
 * @PackageName: com.itheima.service
 * @ClassName: DishService
 * @Description:
 * @Author: zhangcheng
 * @DateTime: 2022/6/8 17:57
 * @Version 1.0
 */

@Transactional  //操作多张表,加事务  启动类要加@EnableTransactionManagement
public interface DishService extends IService<Dish> {
    //新增菜品,同时插入菜品对应的口味数据,要操作两张表 dish、dish_flavor
    void saveWithFlavor(DishDto dishDto);

    //根据id查询菜品信息和对应的口味信息
    DishDto getByIdWithFlavor(Long id);

    //修改菜品信息和对应的口味信息
    void updateWithFlavor(DishDto dishDto);
}
